
document.head.innerHTML+="<link rel=icon href=icon.png >"
function save() {
  if(document.getElementById("ontext").value=="incognitio"){alert("hello!oho!");return;}
  document.getElementById("save").disabled=true;
  var val;
  val = document.getElementById("offtext").value;
  localStorage["off"] = ((val=="")?"off":val);
  val = document.getElementById("ontext" ).value;
  localStorage["on"] =  ((val=="")?"on" :val); 
  val = document.getElementById("alt" ).checked;
  localStorage["alt"] =  (val?"true":"false");
  setInterval(function(){
    document.getElementById("save").disabled=false;
  },1500);
  chrome.extension.sendRequest({info:"refbdg"},function(resp){})
  chrome.storage.sync.set({
    on :localStorage["on" ],
    off:localStorage["off"],
    alt:localStorage["alt"]},
  function(){
  chrome.extension.getBackgroundPage().initset({
    on :localStorage["on" ],
    off:localStorage["off"],
    alt:localStorage["alt"]}
    )
  })
}

function rest() {
  var val,node;
  val = localStorage["on" ];
  node = document.getElementById("ontext" );
  if (val)  node.value=val; else node.value="on";
  val = localStorage["off"];
  node = document.getElementById("offtext");
  if (val)  node.value=val; else node.value="off";
  val = localStorage["alt"];
  node = document.getElementById("alt");
  if (val=="true")  node.checked=true; else node.checked=false;
}
function help()
{
  if(document.getElementById("help").hidden)
    document.getElementById("help").hidden=false;
  else
    document.getElementById("help").hidden=true;
}
onkeydown=function(e){
  if(
    (e.ctrlKey||e.metaKey)
    &&e.altKey
    &&e.keyIdentifier=="Shift")
  alert("hello");
}
onload=function(){
document.getElementById("shhelp").onclick=help;
document.getElementById("save").onclick=save;
rest();
}
